#============================================================
#	Canvas
#============================================================
# @datetime: 2022-4-20 03:39:16
#============================================================
class_name PlayerCanvas
extends Node2D


onready var _sprite := get_node("Sprite") as Sprite
onready var _animation_player := get_node("Sprite/AnimationPlayer") as AnimationPlayer
onready var _attack_effect := get_node("AttackEffect") as AnimatedSprite


#============================================================
#   自定义
#============================================================
##  播放
## @anim_name  
func play(anim_name: String):
	_animation_player.play(anim_name)


##  水平翻转
## @value  
func flip_h(value: bool):
	scale.x = abs(scale.x) * (-1 if value else 1)


